package com.sise.producer8002.controller;

import com.sise.producer8002.service.MessageProvider;
import com.sise.producer8002.service.personService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author:ljf
 * @date: 2020/6/9
 * @description:
 **/
@RestController
public class personController {

    @Resource
    private personService personService;

    @Resource
    private MessageProvider messageProvider;


    @ResponseBody
    @RequestMapping(value = "openFeign/getPersonById/{id}")
    public String findPerson(@PathVariable("id") Integer id){
        String person = personService.findPerson(id).toString();
        String s = messageProvider.sendMessage(person);
        return  person;
    }
}
